package contactbook.service;

import java.util.List;
import java.util.Set;

import contactbook.dao.AccountDAOInterface;
import contactbook.dao.ContactDAOInterface;
import contactbook.dao.GroupDAOInterface;
import contactbook.model.Contact;

public interface ContactServiceInterface {
	
	public static String JNDI = "ContactBookEar/ContactService/remote";
	
	public void login(String login, String password);
	public void logout();
	
	/* Adds a contact and affect it to the group with the id 'groupId' */
	public Contact add(Contact contact, int groupId);
	/* Adds a contact without affecting to any group */
	public Contact add(Contact contact);
	public void update(Contact contact);
	public void delete(int contactId);
	
	public Contact getContactById(int contactId);
	public List<Contact> getContactsByName(String firstName, String lastName);
	public Set<Contact> getContacts();
	public Set<Contact> getContacts(int groupId);
	public List<Contact> getContactsWithoutGroup();
	
	public boolean isLogged();
	
	/* Change DAO : for business layer tests */
	public void setDAO(ContactDAOInterface contactDao, GroupDAOInterface groupDao, AccountDAOInterface accountDao);
}
